<?php
namespace app\common\validate;

use think\Validate;

class Admin extends \app\extra\BaseValidate
{
//创建当前验证规则
    protected $rule = [
        'username|用户名' =>[
//            'require',
//            'length' => '0,200',
//            'alphaNum',//只能是字母和数字
//            'unique:Admin',
        ],
        'nickname|呢称' =>[
//            'chsAlphaNum', //仅允许汉子、字母和数字
        ],
        'email|邮箱' =>[
//            'email' => 'email',
        ],
        'password|密码' =>[
//            'length' => '0,50',
//            'alphaNum',//只能是字母和数字
        ],
        'telephone|手机号' =>[
        ],
    ];
    protected $scene = [
        'edit'  =>  ['username','nickname','telephone','email'],
        'add'  =>  ['username','nickname','telephone','email'],
        'login'  =>  ['username','password'],
        'editPwd'  =>  ['password'],
    ];
}